1. Technical Field
The present invention relates generally to an improved data processing system and in particular to a method and apparatus for processing graphics data. Still more particularly, the present invention provides a method and apparatus for window clipping.
2. Description of Related Art
Data processing systems, such as personal computers and work stations, are commonly utilized to run computer-aided design (CAD) applications, computer-aided manufacturing (CAM) applications, and computer-aided software engineering (CASE) tools. Engineers, scientists, technicians, and others employ these applications daily. These applications involve complex calculations, such as finite element analysis, to model stress in structures. Other applications include chemical or molecular modeling applications. CAD/CAM/CASE applications are normally graphics intensive in terms of the information relayed to the user. Data processing system users may employ other graphics intensive applications, such as desktop publishing applications. Generally, users of these applications require and demand that the data processing systems be able to provide extremely fast graphics information.
The processing of a graphics data stream to provide a graphical display on a video display terminal requires an extremely fast graphics system to provide a display with a rapid response. In these types of graphics systems, primitives are received for processing and display. A primitive is a graphics element that is used as a building block for creating images, such as, for example, a point, a line, an arc, a cone, or a sphere. A primitive is defined by a group of one or more vertices. An attribute is used to define how a primitive will be displayed. Attributes include, for example, line style, color, and surface texture. A vertex defines a point, an end point of an edge, or a corner of a polygon where two edges meet. Data also is associated with a vertex in which the data includes information, such as positional coordinates, colors, normals, and texture coordinates. Commands are sent to the graphics system to define how the primitives and other data should be processed for display.
With the large amounts of data and computations involved in processing graphics data, especially with three-dimensional applications, many of these computations have been offloaded from the central processing units to a graphics adapter. Within these graphics systems, a graphics pipeline located in the graphics adapter is used to process this graphics data. With a pipeline, the graphics data processing is partitioned into stages of processing elements in which processing data may be executed sequentially by separate processing elements.
Within these processing elements, a clipping function is typically implemented in which pixels for a primitive located within a clip area are rendered, while pixels for the primitive outside of the clip area are not rendered. The hardware implementing the clipping function is often referred to as a hardware clipper. Often, more than one clip area is used to render the correct pixels on a display. With some high-end graphics adapters, multiple hardware clippers are present to clip graphics primitives. Clipping primitives, such as lines and segments, are faster using hardware clippers, rather than software clippers.
In some cases, the number of clipping areas exceed the number of hardware clippers present in a graphics adapter. Presently, in this situation, the clipping function is handled by software or clip planes, rather than by hardware clipper. As a result, the performance and speed in displaying images is reduced as compared to using hardware clippers. It is possible to increase the number of hardware clippers, but the increase compounds the complexity in designing the graphics adapter and raises the cost of the graphics adapter. Additionally, such a solution is not applicable to graphics adapters already manufactured and in use.
Therefore, it would be advantageous to have a method and apparatus for providing a clipping function in which software clipping or clip planes is avoided.
The present invention provides a method and apparatus in a data processing system for processing graphics data. A set of clip areas defining a window for use in clipping graphics data is identified in which a portion of the graphics data is obscured. A clip area in a first hardware clipper is set, wherein the clip area encompasses the window to process the graphics data. The graphics data within the first clip area is graphics data to be displayed. A no clip area is set in a second hardware clipper, wherein the no clip area encompasses the portion and wherein which graphics data in the second clip area is to remain undisplayed. The graphics data is sent to the first hardware clipper and the second hardware clipper.